#ifndef BOSECMD_UTILS_H
#define BOSECMD_UTILS_H
#ifdef __ANDROID__
#include <utils/Log.h>
#endif


#define MAX_CMD_LEN (1024)

#undef TAG
#define TAG "BOSECMD"
#ifdef __ANDROID__
#define BOSE_LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__)
#define BOSE_LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__)
#define BOSE_LOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__)
#define BOSE_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__)
#else
#define BOSE_LOGI(str, ...) do{printf("BOSECMD ");printf(str,##__VA_ARGS__);printf("\n");}while(0)
#define BOSE_LOGD(str, ...) do{printf("BOSECMD ");printf(str,##__VA_ARGS__);printf("\n");}while(0)
#define BOSE_LOGW(str, ...) do{printf("BOSECMD ");printf(str,##__VA_ARGS__);printf("\n");}while(0)
#define BOSE_LOGE(str, ...) do{printf("BOSECMD ");printf(str,##__VA_ARGS__);printf("\n");}while(0)
#endif

void str2Argv(char** argv, const char* str, int maxLines);
int bose_file_read(const char *path, void *buffer, int max_file_len);
int bose_file_write(const char *path, const char *value, int max_file_len);

#endif